package com.letoken.platform.app.controller;


import com.letoken.platform.app.service.AppVersionInfoService;
import com.letoken.platform.pub.annotation.auth.NotAuthorization;
import com.letoken.platform.pub.annotation.pub.Trim;
import com.letoken.platform.pub.res.ApiResponse;
import com.letoken.platform.repo.app.req.version.AppVersionInfoReq;
import com.letoken.platform.repo.app.res.version.AppVersionInfoRes;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * app版本信息控制器
 *
 * @author : hfanghao
 * @date : 2022-01-18 16:28
 **/
@RestController
@RequestMapping("/version")
@Api(tags = "App基础接口", description = "app版本信息相关接口")
public class AppVersionInfoController {

    @Autowired
    private AppVersionInfoService appVersionInfoService;

    @Trim
    @PostMapping("/updateCheck")
    @ApiOperation(value = "检查版本更新接口", notes = "检查版本更新接口")
    @NotAuthorization
    public ApiResponse<AppVersionInfoRes> updateCheck(@Validated @RequestBody AppVersionInfoReq req) {
        return ApiResponse.create(appVersionInfoService.updateCheck(req));
    }

}
